<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="az" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>

    <%@include file="/view/common/common-href.jsp" %>


</head>

<%--<body>
    <form id="form" method="post">
        <div>
            <label>账户:</label>
            <input class="easyui-validatebox" type="text" id="account" name="account" value="admin" placeholder="" data-options="required:true"/>
        </div>
        <div>
            <label>密码:</label>
            <input class="easyui-validatebox" type="password" id="passwd" name="passwd" value="111111" placeholder="" data-options="required:true"/>
        </div>
        <a href="javascript:formClick();">登录</a>
    </form>
</body>--%>

<body class="login">
<div>
    <div class="login_wrapper">

        <div class="animate form login_form">
            <section class="login_content">

                <form id="ff" method="post">
                    <h1>后台管理</h1>
                    <div>
                        <input class="easyui-validatebox form-control" type="text" data-options="required:true"
                               id="account" name="account" value="admin" placeholder="账户名称"/>
                    </div>
                    <div>
                        <input class="easyui-validatebox form-control" type="password" data-options="required:true"
                               id="passwd" name="passwd" value="111111" placeholder="登录密码"/>
                    </div>
                    <div>
                        <a class="btn btn-default submit" href="javascript:void(0);"
                           onclick="$AzerothData.methods.login();">登录</a>
                    </div>

                    <div class="clearfix"></div>

                    <div class="separator">
                        <p class="change_link">提供对数据的基础设置与管理</p>

                        <div class="clearfix"></div>
                    </div>
                </form>

            </section>
        </div>

    </div>
</div>
</body>

</html>
<script type="text/javascript">

    $(document).keyup(function(event){
        if(event.keyCode ==13){
            $AzerothData.methods.login();
        }
    });

    $AzerothData.methods.login = function() {

        $("#ff").form('submit', {
            url: "${az}/login/login",
            onSubmit: function() {
                return $(this).form("validate");
            },
            success: function(data) {
                console.info(data);
                if($AzerothData.statusCode(data)) {
                    location.href="${az}/view/system/frame.jsp";
                }
            }
        });

    }
</script>